<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>CK宠物网  admin 管理文章</title>
    <jsp:include page="top_utils.jsp"></jsp:include>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/myplace.css"/>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/myspace.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/my_adopt.css">
  </head>
  
  <body>
 	<!-- 头部-->
	<div class="headnav">
		<div class="topBar">
			<div class="topBarL">
				<jsp:include page="logo.jsp"></jsp:include>
				<div class="nav">
					<li>
							<a href="${pageContext.request.contextPath }/">首页</a>
						</li><ul>
						
						<li>
							<a href="${pageContext.request.contextPath }/news/">新闻</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath }/adopt/">领养</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath }/knowledge/">知识</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath }/shopping/">商城</a>
						</li>
					</ul>
				</div>
			</div>

			<jsp:include page="topBarR.jsp"></jsp:include>
		</div>
	</div>
 	
	<div id="main" style="background:url('/dogstore/images/${user.backimg}')  no-repeat center top;">
	  <jsp:include page="my_top.jsp"></jsp:include>
	  
	  <div class="layout-body">
	    <div class="w960  clf">   
	      <div class="m_main">
	        <div class="inner centers_mr"> 
     			<c:if test="${user.issale_power == 0 }">
     				<div class="public_m2">管理员可审核申请实名认证的用户...</div>
     			</c:if>
     			<a class="layui-btn layui-btn-small" href="${pageContext.request.contextPath }/user/myspace">返回个人主页</a>
				<a class="layui-btn layui-btn-small" onclick="javascript:history.back(-1);">返回上一步</a>
				<br/>
				<br/>
	     		<div class="tip_notem">
	     			<br/>
	     			
	     			<style>
	     				.layui-table th{
	     					font-size:15px;
	     					font-weight:bold;
	     					float:none;
	     				}
	     			</style>
	            	<fieldset class="layui-elem-field site-demo-button">
					  <legend>申请列表</legend>
					  	 <a class="layui-btn layui-btn-normal layui-btn-radius" href="${pageContext.request.contextPath }/user/my_usersend">未通过的申请用户</a>
					  	 <a class="layui-btn layui-btn-normal layui-btn-radius" href="${pageContext.request.contextPath }/user/my_usersended">已通过的申请用户</a>
					     <br/>
						 <br/>
					     <c:if test="${isnull == '1'}">
							<div class="layui-form">
							  <table class="layui-table">
							    <colgroup>
							      <col width="10%">
							      <col width="10%">
							      <col width="10%">
							      <col width="10%">
							      <col width="15%">
							      <col width="15%">
							      <col width="15%">
							      <col width="15%">
							    </colgroup>
							    <thead>
							      <tr>
							      	<th>用户名</th>
							        <th>邮箱</th>
							        <th>号码</th>
							        <th>性别</th>
							        <th>真实姓名</th>
							        <th>领养性质</th>
							        <th>申请时间</th>
							        <th>操作</th>
							      </tr> 
							    </thead>
							    <tbody>
							      <c:forEach items="${list }" var="ado">
							      	 <tr>
								        <td>
								        	<a href="javascript:" style="font-size: 5px;">${ado.username }</a>
								        </td>
								        
								        <td>${ado.email }</td>
								        
								        <td>${ado.phone }</td>
								        
								        <td>${ado.sex }</td>
								        
								        <td>${ado.realname }</td>
								        
								        <td>${ado.salename }</td>
								        
								        <td>${ado.sendtime }</td>
											
								        <td>
								        	<c:if test="${ado.issale_power == 0 }">
								        		<div class="button-group">
									        		<a class="layui-btn layui-btn-small layui-btn-warm" id="${ado.id }" onclick="return fortrue_send(this.id);">审核通过</a>
									        	</div>
								        	</c:if>
								        </td>
								     </tr>
							      </c:forEach>
							    </tbody>
							  </table>
							</div>						     
					     </c:if>
					     <c:if test="${isnull == '0'}">
					     	<h2>最近没有用户申请...</h2>
					     	<br/>
					     	<br/>
					     	
					     </c:if>
					  </div>
					</fieldset>
	            </div>
	        </div>
	      </div>
	      
	    </div>
	  </div>
	</div>
	
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/my_adopt.css">
	  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/myspace.css">
	<jsp:include page="footer.jsp"></jsp:include>
  </body>
  <script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath }/js/head.js"></script>
  <script>
  	window.onload=function (){
		if(${user == null}){
			layer.msg("你未登录!",{shift: 6});
			setTimeout(function (){
				window.location.href="/dogstore/";
			},1500);
		}
 	};
 	
 	
 	$(document).ready(function(){
 		
 	});
 	
 	function del(id){
 		layer.confirm('确定审核？', {
			btn: ['确定','取消'] //按钮
		}, function(){
			//确定
		  	var index = layer.load(1, {time: 10000});;
		  	$.ajax({
	 			type:"post",
				url:"/dogstore/user/fortrue_send.action",
				async:false, 
	 			data:{
	 				id:id
	 			},
	 			success:function (error){
	 				if(error == "0"){
	 					layer.close(index);
	 					layer.msg("审核成功!",{icon: 1,shift: 1});
	 					setTimeout(function (){
							//刷新
							window.location.reload();
						},1000);
	 				}else{
	 					layer.close(index);
	 					layer.msg("审核失败!请联系prince!500",{icon: 2,shift: 6});
	 				}
	 			},
	 			error:function (){
	 				layer.close(index);
	 				layer.msg("审核失败!请联系prince!",{icon: 2,shift: 6});
	 			} 			
	 		},"json");
		}, function(){
			//取消
		 	return; 
		});
 		
 	}
  </script>
</html>
